<template>
	<view class="matching">
		<view class="nav">
			<view class="back" @click="headleBack">
				<image src="../../static/image/backhei.png"></image>
				<view>返回</view>
			</view>
			<view class="user_head">
				<view>
					<image :src="userInfo.avatarUrl"></image>
				</view>
				<view>{{userInfo.nickName}}</view>
			</view>
		</view>
		<view class="container">
			<view class="user_header">
				<view class="title">基本信息</view>
				<view class="content">
					<view class="item">
						<view>
							<image src="../../static/image/birthday.png"></image>
							<view>生日</view>
						</view>
						<view>{{userInfo.birthday}}</view>
					</view>
					<view class="item">
						<view>
							<image src="../../static/image/constellation.png"></image>
							<view>星座</view>
						</view>
						<view>{{constellationList[userInfo.starSign]}}</view>
					</view>
					<view class="item">
						<view>
							<image src="../../static/image/stature.png"></image>
							<view>身高</view>
						</view>
						<view>{{userInfo.height}}</view>
					</view>
					<view class="item">
						<view>
							<image src="../../static/image/city.png"></image>
							<view>现居城市</view>
						</view>
						<view>{{userInfo.province}}·{{userInfo.city}}</view>
					</view>
					<view class="item">
						<view>
							<image src="../../static/image/status.png"></image>
							<view>现状</view>
						</view>
						<view>{{currentList[userInfo.situation]}}</view>
					</view>
				</view>
				<view>
				</view>
			</view>

			<view class="user_tag">
				<view class="title">关于自己</view>
				<view class="tag_box">
					<view v-for="item in userInfo.my_tags" :key="item.id">{{item.name}}</view>
				</view>
			</view>
			<view class="user_tag">
				<view class="title">喜欢的类型</view>
				<view class="tag_box">
					<view v-for="item in userInfo.like_tags" :key="item.id">{{item.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 星座列表
				constellationList: ["白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座"],
				currentList: ["学生党", "工作党"], //现状
				userInfo: {}
			}
		},
		onLoad(options) {
			this.userInfo = JSON.parse(options.userInfo)

		},
		methods: {
			headleBack() {
				let pages = getCurrentPages()
				if (pages.length > 1) {
					uni.navigateBack()
				} else {
					uni.navigateTo({
						url: '../index/index'
					})
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.matching {
		padding: 40upx;

		.nav {
			margin-bottom: 30upx;

			.back {
				display: flex;
				width: 100upx;

				image {
					width: 36upx;
					height: 36upx;
					margin-right: 2upx;
				}

				view {
					color: rgba(0, 0, 0, 0.8);
					font-size: 26upx;
				}
			}

			.user_head {
				color: rgba(0, 0, 0, 0.8);
				font-size: 30upx;
				font-weight: 600;
				display: flex;
				flex-direction: column;
				align-items: center;

				view:first-child {
					width: 150upx;
					height: 150upx;
					border-radius: 50%;
					background-color: rgba(255, 255, 255, 100);
					border: 6upx solid rgba(227, 222, 255, 100);
					margin-bottom: 20upx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}
			}
		}

		.container {
			.user_header {
				padding: 40upx 0upx;
				width: 100%;
				height: 506upx;
				border-radius: 20upx;
				background-color: rgba(247, 246, 254, 100);
				margin-bottom: 30upx;
			}


			.title {
				position: relative;
				border-bottom: 2upx solid rgba(255, 255, 255, 100);
				padding: 0upx 40upx 30upx 62upx;
				color: rgba(0, 0, 0, 0.8);
				font-size: 30upx;
				font-weight: 600;
			}

			.title:before {
				position: absolute;
				left: 41rpx;
				top: 5upx;
				content: "";
				width: 6upx;
				height: 34upx;
				background-color: rgba(130, 113, 239, 100);
			}

			.content {
				padding: 0upx 40upx;

				.item {
					display: flex;
					justify-content: space-between;
					color: rgba(0, 0, 0, 0.8);
					font-size: 28upx;
					margin-top: 30upx;

					view:first-child {
						display: flex;
						align-items: center;
						color: rgba(16, 16, 16, 0.45);
						font-size: 30upx;

						image {
							width: 40upx;
							height: 40upx;
							margin-right: 10upx;
						}
					}
				}
			}

			.user_tag {
				background-color: rgba(247, 246, 254, 100);
				padding: 40upx 0upx 20upx;
				margin-bottom: 30upx;

				.tag_box {

					display: flex;
					flex-wrap: wrap;
					padding: 30upx 20upx 0upx 40upx;

					view {
						padding: 10upx 20upx;
						border-radius: 200upx;
						background-color: rgba(130, 113, 239, 100);
						color: rgba(255, 255, 255, 100);
						font-size: 26upx;
						text-align: center;
						margin: 0upx 20upx 20upx 0upx;
					}
				}
			}
		}
	}
</style>
